/**
 * KopsoxFramework
 * Copyright (C) 2010 Free Software Foundation, Inc. <http://fsf.org/>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.

 */
package org.kopsox.general.priority;

import org.kopsox.general.priority.impl.PriorityImpl;

/**
 * @author Konrad Renner
 * 
 */
public enum PriorityEnum {

	LOWEST(new PriorityImpl(0)), 
	LOWER(new PriorityImpl(1)), 
	LOW(new PriorityImpl(2)), 
	MEDIUM(new PriorityImpl(3)), 
	HIGH(new PriorityImpl(4)), 
	HIGHER(new PriorityImpl(5)), 
	HIGHEST(new PriorityImpl(6));

	private final Priority value;

	private PriorityEnum(Priority value) {
		this.value = value;
	}

	public Priority getPriority() {
		return value;
	}
	
	public static String getPriorityValueAsString(Priority priority) {
		if(LOWEST.getPriority().equals(priority)) {
			return LOWEST.toString();
		}else if(LOWER.getPriority().equals(priority)) {
			return LOWER.toString();
		}else if(LOW.getPriority().equals(priority)) {
			return LOW.toString();
		}else if(MEDIUM.getPriority().equals(priority)) {
			return MEDIUM.toString();
		}else if(HIGH.getPriority().equals(priority)) {
			return HIGH.toString();
		}else if(HIGHER.getPriority().equals(priority)) {
			return HIGHER.toString();
		}else if(HIGHEST.getPriority().equals(priority)) {
			return HIGHEST.toString();
		}else {
			return Integer.toString(priority.getPriorityValue());
		}
	}
}
